/**
 * Copyright (c) 2010, QinJian
 * All rights reserved.
 */
package com.q.course.web.classes;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.q.course.entity.classes.Classes;
import com.q.course.service.classes.ClassesService;

/**
 * @author 覃健,Email:j411@qq.com
 *
 */
@Controller
@RequestMapping("/classes")
public class ClassesController {

	@Autowired
	private ClassesService classesService;
	
	@ResponseBody
	@RequestMapping( value="/save.do" , method = RequestMethod.POST )
	public Object[] saveClasses(Classes classes){
		return classesService.saveClasses(classes);
	}
	
	@ResponseBody
	@RequestMapping( value="/getclasses.do" , method = RequestMethod.GET )
	public List<Classes> getClasses(){
		
		return classesService.getClasses();
	}
	
	@ResponseBody
	@RequestMapping( value="/getbyplace.do" , method = RequestMethod.GET )
	public List<Classes> getByPlace(Classes classes){
		
		return classesService.getByPlace(classes.getPlaceId());
	}
	
	@ResponseBody
	@RequestMapping( value="/getclaslist.do" , method = RequestMethod.GET )
	public List<Classes> getClassList(){
		return classesService.getClassList();
	}
}
